package com.ts.api.module.distribute.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 *  分配链接实体
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DistributeLinkPO {

    /** 子链接主键 */
    private Long id;
    /** 链接组主键 */
    private Long groupId;
    /** 链接切换数 */
    private Integer linkMaxClick;
    /** 子链接地址 */
    private String url;
    /** 子链接状态 0禁用1启用 */
    private Integer status;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DistributeLinkPO that = (DistributeLinkPO) o;
        return Objects.equals(id, that.id) && Objects.equals(groupId, that.groupId) && Objects.equals(linkMaxClick, that.linkMaxClick);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, groupId, linkMaxClick, url);
    }
}
